home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / texted1a / frmfind.frm (.txt) < prev    next >
Visual Basic Form  |  1999-09-15  |  4KB  |  133 lines

  1. VERSION 5.00
  2. Begin VB.Form frmFind 
  3.    Caption         =   "Find Text"
  4.    ClientHeight    =   1500
  5.    ClientLeft      =   930
  6.    ClientTop       =   945
  7.    ClientWidth     =   5415
  8.    LinkTopic       =   "Form1"
  9.    MDIChild        =   -1  'True
  10.    ScaleHeight     =   1500
  11.    ScaleWidth      =   5415
  12.    Begin VB.CommandButton cmdFind 
  13.       Caption         =   "&Find"
  14.       Default         =   -1  'True
  15.       Height          =   255
  16.       Left            =   240
  17.       Style           =   1  'Graphical
  18.       TabIndex        =   6
  19.       ToolTipText     =   "Start Search"
  20.       Top             =   1200
  21.       Width           =   1092
  22.    End
  23.    Begin VB.CommandButton cmdcancel 
  24.       Cancel          =   -1  'True
  25.       Caption         =   "Cancel"
  26.       Height          =   255
  27.       Left            =   3960
  28.       TabIndex        =   5
  29.       ToolTipText     =   "Return to Notepad"
  30.       Top             =   1200
  31.       Width           =   1092
  32.    End
  33.    Begin VB.TextBox txtFind 
  34.       Height          =   285
  35.       Left            =   720
  36.       TabIndex        =   0
  37.       ToolTipText     =   "Text to Find"
  38.       Top             =   120
  39.       Width           =   4575
  40.    End
  41.    Begin VB.CheckBox chkCase 
  42.       Caption         =   "Match &Case"
  43.       Height          =   495
  44.       Left            =   120
  45.       TabIndex        =   4
  46.       ToolTipText     =   "Case Sensitivity"
  47.       Top             =   600
  48.       Width           =   1335
  49.    End
  50.    Begin VB.Frame Frame1 
  51.       Caption         =   "Direction"
  52.       Height          =   612
  53.       Left            =   3240
  54.       TabIndex        =   1
  55.       Top             =   480
  56.       Width           =   2052
  57.       Begin VB.OptionButton optDirection 
  58.          Caption         =   "&Up"
  59.          Height          =   252
  60.          Index           =   0
  61.          Left            =   240
  62.          TabIndex        =   3
  63.          ToolTipText     =   "Search to Beginning of Document"
  64.          Top             =   240
  65.          Width           =   612
  66.       End
  67.       Begin VB.OptionButton optDirection 
  68.          Caption         =   "&Down"
  69.          Height          =   252
  70.          Index           =   1
  71.          Left            =   960
  72.          TabIndex        =   2
  73.          ToolTipText     =   "Search to End of Document"
  74.          Top             =   240
  75.          Value           =   -1  'True
  76.          Width           =   852
  77.       End
  78.    End
  79.    Begin VB.Label Label1 
  80.       Caption         =   "Fi&nd :"
  81.       Height          =   255
  82.       Left            =   120
  83.       TabIndex        =   7
  84.       Top             =   120
  85.       Width           =   495
  86.    End
  87. Attribute VB_Name = "frmFind"
  88. Attribute VB_GlobalNameSpace = False
  89. Attribute VB_Creatable = False
  90. Attribute VB_PredeclaredId = True
  91. Attribute VB_Exposed = False
  92. Option Explicit
  93. Private Sub chkCase_Click()
  94.     ' Assign a value to the public variable.
  95.     FindCase = chkCase.Value
  96. End Sub
  97. Private Sub cmdCancel_Click()
  98.     ' Save the values to the public variables.
  99.     FindStrings = txtFind.Text
  100.     FindCase = chkCase.Value
  101.     ' Unload the find dialog.
  102.     Unload frmFind
  103. End Sub
  104. Private Sub cmdFind_Click()
  105.     ' Assigns the text string to a public variable.
  106.     FindStrings = txtFind.Text
  107.     FindIt
  108. End Sub
  109. Private Sub Form_Load()
  110.     ' Disable the find button - no text to find yet.
  111.     cmdFind.Enabled = False
  112.     ' Read the public variable & set the option button.
  113.     optDirection(FindDirection).Value = 1
  114.     Me.Height = 1905
  115.     Me.Width = 5535
  116.     Me.Left = 1455
  117.     Me.Top = 1500
  118. End Sub
  119. Private Sub optDirection_Click(Index As Integer)
  120.     ' Assign a value to the public variable.
  121.     FindDirection = Index
  122. End Sub
  123. Private Sub txtFind_Change()
  124.     ' Set the public variable.
  125.     FirstTime = True
  126.     ' If the textbox is empty, disable the find button.
  127.     If txtFind.Text = "" Then
  128.         cmdFind.Enabled = False
  129.     Else
  130.         cmdFind.Enabled = True
  131.     End If
  132. End Sub
  133.